cmake_minimum_required(VERSION 3.5)
project(board_control)
set(CMAKE_CXX_STANDARD 17)

set(MAVSDK_DIR /home/jr02/MAVSDK/install/lib/cmake/MAVSDK)
find_package(MAVSDK REQUIRED)

# find_package(SDL2 REQUIRED)

find_package(catkin REQUIRED COMPONENTS
  message_generation
  roscpp
  rospy
  std_msgs
)

add_message_files(
  FILES
  Axis.msg
  BoardControl.msg
)

generate_messages(
  DEPENDENCIES
  std_msgs  # 依赖的消息包
)


catkin_package(
  INCLUDE_DIRS include
  LIBRARIES board_control
  CATKIN_DEPENDS message_runtime roscpp rospy std_msgs
#  DEPENDS system_lib
)

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
  ${SDL2_INCLUDE_DIRS}
)

add_executable(board_control
  src/keyboard_control.cpp
  include/joystick/joystick.cpp
)
# target_link_libraries(keyboard_control MAVSDK::mavsdk)

target_link_libraries(board_control
  ${catkin_LIBRARIES}
  MAVSDK::mavsdk
)
